package com.link510.aitools.core.enums;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum EventCommand implements Serializable {

    OpenDoor("opendoor", "开门"),
    CloseDoor("closedoor", "关门"),
    Reboot("reboot", "重启");

    private final String command;

    private final String title;


    public static EventCommand getEventCommand(String command) {

        try {
            return Arrays.stream(values())
                    .filter(Objects::nonNull)
                    .filter(x -> x.command.equals(command))
                    .findFirst().orElse(null);

        } catch (Exception ignored) {

        }

        return null;
    }


}
